package com.bdqn.service.impl;
import com.bdqn.mapper.SysUserMapper;
import com.bdqn.pojo.SysUser;
import com.bdqn.service.SysUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
/**
 * 用户模块业务实现层
 */
@Transactional
@Service("sysUserService")
public class SysUserServiceImpl implements SysUserService {
    @Autowired
    private SysUserMapper sysUserMapper;
    @Override
    public List<SysUser> getList(SysUser sysUser) {
        try {
            return sysUserMapper.getList(sysUser);
        } catch (RuntimeException e) {
            e.printStackTrace();
          throw e;
        }
    }

    @Override
    public boolean add(SysUser sysUser) {
        boolean result = false;
        try {
            if(sysUserMapper.add(sysUser)==1){
                result =true;
            }
        } catch (RuntimeException e) {
          e.printStackTrace();
          throw e;
        }
        return result;
    }

    public SysUserMapper getSysUserMapper() {
        return sysUserMapper;
    }

    public void setSysUserMapper(SysUserMapper sysUserMapper) {
        this.sysUserMapper = sysUserMapper;
    }
}
